package com.ruoyi.config.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.config.mapper.AgreementConfigMapper;
import com.ruoyi.config.domain.AgreementConfig;
import com.ruoyi.config.service.IAgreementConfigService;

/**
 * 协议设置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-10
 */
@Service
public class AgreementConfigServiceImpl implements IAgreementConfigService 
{
    @Autowired
    private AgreementConfigMapper agreementConfigMapper;

    /**
     * 查询协议设置
     * 
     * @param id 协议设置主键
     * @return 协议设置
     */
    @Override
    public AgreementConfig selectAgreementConfigById(Long id)
    {
        return agreementConfigMapper.selectAgreementConfigById(id);
    }

    /**
     * 查询协议设置列表
     * 
     * @param agreementConfig 协议设置
     * @return 协议设置
     */
    @Override
    public List<AgreementConfig> selectAgreementConfigList(AgreementConfig agreementConfig)
    {
        return agreementConfigMapper.selectAgreementConfigList(agreementConfig);
    }

    /**
     * 新增协议设置
     * 
     * @param agreementConfig 协议设置
     * @return 结果
     */
    @Override
    public int insertAgreementConfig(AgreementConfig agreementConfig)
    {
        agreementConfig.setCreateTime(DateUtils.getNowDate());
        return agreementConfigMapper.insertAgreementConfig(agreementConfig);
    }

    /**
     * 修改协议设置
     * 
     * @param agreementConfig 协议设置
     * @return 结果
     */
    @Override
    public int updateAgreementConfig(AgreementConfig agreementConfig)
    {
        agreementConfig.setUpdateTime(DateUtils.getNowDate());
        return agreementConfigMapper.updateAgreementConfig(agreementConfig);
    }

    /**
     * 批量删除协议设置
     * 
     * @param ids 需要删除的协议设置主键
     * @return 结果
     */
    @Override
    public int deleteAgreementConfigByIds(Long[] ids)
    {
        return agreementConfigMapper.deleteAgreementConfigByIds(ids);
    }

    /**
     * 删除协议设置信息
     * 
     * @param id 协议设置主键
     * @return 结果
     */
    @Override
    public int deleteAgreementConfigById(Long id)
    {
        return agreementConfigMapper.deleteAgreementConfigById(id);
    }
}
